<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="root">

    </div>
</body>
<script src="../react@17.js"></script>
<script src="../react-dom@17.js"></script>
<script src="../babel.js"></script>
<script type="text/babel">
    //  父 constructor => 父render =>子constructor=>子render =>子componentDidMount=>父componentDidMount
    class App extends React.Component {
        constructor(props) {
            super(props)
            console.log("父组件-----construtor")
        }
        render() {
            console.log("父组件-----render")
            return (
                <div>
                    <Child/>
                </div>
            )
        }
        componentDidMount() {
            console.log("父组件-----didMount")
        }
    }
    class Child extends React.Component{
        constructor(props) {
            super(props)
            console.log("子组件-----construtor")
        }
        render() {
            console.log("子组件-----render")
            return (
                <div>
                    <h1>子组件</h1>
                </div>
            )
        }
        componentDidMount() {
            console.log("子组件-----didMount")
        }
    }
    ReactDOM.render(<App />, document.getElementById("root"))
</script>

</html>